import request from "@/utils/request.js"

/**
 * 库存
 */

export function stockList(data) {
	return request({
		url: '/stock-api/goods/list',
		method: 'GET',
		data,
	})
}

export function stockInfo(id) {
	return request({
		url: '/stock-api/goods/' + id,
		method: 'GET',
	})
}

export function stockSave(data, update = false) {
	return request({
		url: '/stock-api/goods',
		method: update ? 'PUT' : 'POST',
		data,
	})
}

export function createPrintLink(data) {
	return request({
		url: '/stock-api/goods/create_print_link',
		method: 'POST',
		data,
	})
}

export function scanChangeStock(data) {
	return request({
		url: '/stock-api/goods/identity_save_stock',
		method: 'POST',
		data,
	})
}

export function subPrintNum(data) {
	return request({
		url: '/stock-api/goods/get_sub_print_num',
		method: 'GET',
		data,
	})
}